<?php
function capitalize($str) {
	$arr = explode('/', $str);
	foreach ($arr as &$value)
		$value = ucfirst(strtolower($value));
	return implode('/', $arr);
}

function underscore($name) {
	$result = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $name));
	return $result;
}
